package com.example.globalException;

import org.springframework.web.bind.annotation.ControllerAdvice;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.ResponseBody;

@ControllerAdvice
public class GlobalException {

    @ExceptionHandler(value =DefineException.class)
    @ResponseBody
    public ResultBody globalHandle(DefineException defineException){
       return new ResultBody(false,defineException.getCode(),defineException.getMsg());
    }


}
